import { useState, useEffect } from "react"
import Taro from "@tarojs/taro"
interface toast {
  text: string,
  icon?: string,
  isShow: boolean
}
export function useToastHook() {
  let data: toast = {
    text: '',
    icon: '',
    isShow: false
  }
  const [toast, setToast] = useState(data);
  return toast
}
export function useSetTitle(args) {
  useEffect(() => {
    Taro.setNavigationBarTitle({
      title: args
    })
    console.log(args);
  })
}